<?php /* Smarty version Smarty-3.1.14, created on 2017-08-18 10:37:42
         compiled from "E:\phpStudy\WWW\zyshop\admin\templates\news_type_list.html" */ ?>
<?php /*%%SmartyHeaderCode:201745994feefacd120-27799892%%*/if(!defined('SMARTY_DIR')) exit('no direct access allowed');
$_valid = $_smarty_tpl->decodeProperties(array (
  'file_dependency' => 
  array (
    '7b43639b99c483b01d9772d3d0b7b966b80e2e36' => 
    array (
      0 => 'E:\\phpStudy\\WWW\\zyshop\\admin\\templates\\news_type_list.html',
      1 => 1502954234,
      2 => 'file',
    ),
  ),
  'nocache_hash' => '201745994feefacd120-27799892',
  'function' => 
  array (
  ),
  'version' => 'Smarty-3.1.14',
  'unifunc' => 'content_5994feefb052b0_84704456',
  'variables' => 
  array (
    'type' => 0,
    'list' => 0,
    'list1' => 0,
    'page' => 0,
  ),
  'has_nocache_code' => false,
),false); /*/%%SmartyHeaderCode%%*/?>
<?php if ($_valid && !is_callable('content_5994feefb052b0_84704456')) {function content_5994feefb052b0_84704456($_smarty_tpl) {?><?php echo $_smarty_tpl->getSubTemplate ("header.html", $_smarty_tpl->cache_id, $_smarty_tpl->compile_id, null, null, array(), 0);?>

<style>
  table{text-align: center;}
  th{text-align:center; font-weight: bolder;}
  th a{ color:#000000;}
.firtd {	width: 100px;	padding-right: 10px;	text-align: right;}
input {	width: 350px;}
textarea {	width: 350px;	height: 100px;}
</style>
<body>
<div class="fixed-bar">
  <div class="item-title">
    <h3>文章分类列表</h3>
    <select name="cat_id">
    	<!-- <option value="0">所有分类</option> -->
       <?php echo $_smarty_tpl->tpl_vars['type']->value;?>

    </select>
    <input value=" 搜索 " id="but_sousuo" style="width:40px; height:27px; margin-top:13px;" class="button" type="submit">
    <script>
    	$("#but_sousuo").click(function(){ 
			var cat_id=$("select[name=cat_id]").val();
			location.href="news_type.php?act=list&cat_id="+cat_id;
		});
    </script>
    <div style="background:rgba(251,112,45,1);width:125px;height:40px;float:right;text-align:center;border-radius:5px;">
      <a href="news_type.php?act=add">
        <h5 style="padding:10px;color:#fff;">
          添加文章分类
        </h5>
      </a>
    </div>
  </div>
</div>
<div class="fixed_bottom">
  <form method="post" action="" id="aspnetForm" name="form1">
    <table align="center;" class="table tb-type2">
      <thead>
        <tr>
          <th><a>文章分类名称</a></th>
          <th><a>分类类型</a></th>
          <th><a>描述</a></th>
          <th><a>排序</a></th>
          <th><a>操作</a></th>
        </tr>
      </thead>
      <tbody id="sortable">
        <?php  $_smarty_tpl->tpl_vars['list1'] = new Smarty_Variable; $_smarty_tpl->tpl_vars['list1']->_loop = false;
 $_smarty_tpl->tpl_vars['k'] = new Smarty_Variable;
 $_from = $_smarty_tpl->tpl_vars['list']->value; if (!is_array($_from) && !is_object($_from)) { settype($_from, 'array');}
foreach ($_from as $_smarty_tpl->tpl_vars['list1']->key => $_smarty_tpl->tpl_vars['list1']->value){
$_smarty_tpl->tpl_vars['list1']->_loop = true;
 $_smarty_tpl->tpl_vars['k']->value = $_smarty_tpl->tpl_vars['list1']->key;
?>
            <tr id="<?php echo $_smarty_tpl->tpl_vars['list1']->value['cat_id'];?>
" alt="<?php echo $_smarty_tpl->tpl_vars['list1']->value['cat_id'];?>
">
              <td><?php echo $_smarty_tpl->tpl_vars['list1']->value['cat_name'];?>
</td>
              <td><?php echo $_smarty_tpl->tpl_vars['list1']->value['cat_type'];?>
</td>
              <td><?php echo $_smarty_tpl->tpl_vars['list1']->value['cat_desc'];?>
</td>
              <td><?php echo $_smarty_tpl->tpl_vars['list1']->value['sort_order'];?>
</td>
              <td>
                <a href="news_type.php?act=add&cat_id=<?php echo $_smarty_tpl->tpl_vars['list1']->value['cat_id'];?>
">编辑</a>
                <a href="javascript:;" onclick="get_article_cat(this,<?php echo $_smarty_tpl->tpl_vars['list1']->value['cat_id'];?>
)" style="<?php if ($_smarty_tpl->tpl_vars['list1']->value['cat_id']==1){?>display:none;<?php }elseif($_smarty_tpl->tpl_vars['list1']->value['parent_id']==1){?>display:none;<?php }?>">删除</a>
              </td>
            </tr>
        <?php } ?>
      </tbody>
      <input type="hidden" id="ids_list" />
    </table>
    <div class="page"><?php echo $_smarty_tpl->tpl_vars['page']->value;?>
</div>
  </form>
</div>
</body>
<script>
//是否显示在导航栏 
function get_show_price(obj,id,price){
  if(price==1){
    prices="1";
  }else{
    prices="2";
  }
  $.post("news_type.php",{act:'show',cat_id:id,zt:prices},function(data){
    if(data==1){
      layer.msg("操作成功！");
      if(prices==1){
        $(obj).attr("onclick","get_show_price(this,"+id+",2)");
        $(obj).removeClass("fa-check");
        $(obj).addClass("fa-close");
      }else if(prices==2){
        $(obj).attr("onclick","get_show_price(this,"+id+",1)");
        $(obj).removeClass("fa-close");
        $(obj).addClass("fa-check");
      }
    }else if(data==2){
      layer.msg("操作失败！");
    }
  })
}
//ajax删除文章分类
function get_article_cat(obj,id){
  $.post("news_type.php",{act:'delete',cat_id:id},function(data){
    if(data==3){
      layer.alert("该分类下还有子分类，请先删除其子分类");
      return false;
    }else if(data==1){
      layer.msg("操作成功! ");
      $('#'+id).remove();
    }else if(data==2){
      layer.msg("操作失败！");
    }

  }) 
}
</script>
</html><?php }} ?>